package com.obelisco.vista.herramientas;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;

import com.obelisco.vista.componentes.IVentana;
import com.obelisco.vista.controles.*;


/**
 * Factory class for generating the main application screens.
 * 
 * @author Karl Stenerud
 */
public class VentanaFactory implements BeanFactoryAware, IVentanaFactory
{
	private BeanFactory beanFactory;

	public IVentana crearVentana(String name)
	{
		IVentana ventana = null;
		try {
			ventana = (IVentana)beanFactory.getBean(name);
		} 
		catch (Exception ex) {
			ex.printStackTrace();
		}
		
		return ventana;
	}


	public void setBeanFactory(BeanFactory beanFactory) throws BeansException
	{
		this.beanFactory = beanFactory;
	}
}
